﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;

namespace WebChatApi.Common
{
    /// <summary>
    /// Class for Version Match Result
    /// </summary>
    [DataContract]
    public class VersionMatchResult
    {
        /// <summary>
        /// Enum values for UpdateSuggestionValues
        /// </summary>
        [DataContract]
        public enum UpdateSuggestionValues
        {
            /// <summary>
            /// Value indicating unknown
            /// </summary>
            [EnumMember]
            Unknown = 0,
            /// <summary>
            /// Value indicating Stable
            /// </summary>
            [EnumMember]
            Stable = 1,
            /// <summary>
            /// Value indicating Update Recommend
            /// </summary>
            [EnumMember]
            UpdateRecommend = 2,
            /// <summary>
            /// Value indicating Update Required
            /// </summary>
            [EnumMember]
            UpdateRequired = 3,
            /// <summary>
            /// value indicating un-available
            /// </summary>
            [EnumMember]
            Unavailable = 4
        }

        /// <summary>
        /// Gets or sets the update suggestion.
        /// </summary>
        /// <value>
        /// The update suggestion.
        /// </value>
        [DataMember]
        public UpdateSuggestionValues UpdateSuggestion
        {
            get;
            set;
        }

        /// <summary>
        /// Gets or sets the latest version.
        /// </summary>
        /// <value>
        /// The latest version.
        /// </value>
        [DataMember]
        public string LatestVersion
        {
            get;
            set;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="VersionMatchResult"/> class.
        /// </summary>
        public VersionMatchResult()
            : this(UpdateSuggestionValues.Unknown)
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="VersionMatchResult"/> class.
        /// </summary>
        /// <param name="updateSuggestion">The update suggestion.</param>
        public VersionMatchResult(UpdateSuggestionValues updateSuggestion)
        {
            this.UpdateSuggestion = updateSuggestion;
        }
    }
}
